
pkgname=rsync
pkgver=3.1.3
pkgrel=1
pkgdesc="A file transfer program to keep remote files in sync"
arch=('x86_64')
url="https://samba.anu.edu.au/rsync/"
license=('GPL3')
depends=('perl')
backup=('etc/rsyncd.conf' 'etc/xinetd.d/rsync')
source=("https://www.samba.org/ftp/rsync/${pkgname}-${pkgver}.tar.gz"
        'rsyncd.conf'
        'rsync.xinetd'
        'rsyncd.service'
        'rsyncd.socket'
        'rsyncd@.service')
md5sums=('1581a588fde9d89f6bc6201e8129afaf'
         'bce64d122a8e0f86872a4a21a03bc7f3'
         'ea3e9277dc908bc51f9eddc0f6b935c1'
         'ec96f9089d71109557cdcaa3f0633ed6'
         'ae4c381e0c02d6132c7f6ded3f473041'
         '25b520927a788504c094cbc549aff67b')

build() {
	cd ${pkgname}-${pkgver}
 
	./configure --prefix=/usr --with-included-popt 
	make 
}

check() {
	cd ${pkgname}-${pkgver}
	
	make test
}

package() {
	cd ${pkgname}-${pkgver}
	make DESTDIR=${pkgdir} install 
	
	install -Dm644 ../rsyncd.conf ${pkgdir}/etc/rsyncd.conf
	install -Dm644 ../rsync.xinetd ${pkgdir}/etc/xinetd.d/rsync
	install -Dm644 ../rsyncd.service ${pkgdir}/usr/lib/systemd/system/rsyncd.service
	install -m644 ../rsyncd.socket ${pkgdir}/usr/lib/systemd/system/rsyncd.socket
	install -m644 ../rsyncd@.service ${pkgdir}/usr/lib/systemd/system/rsyncd@.service
	install -Dm755 support/rrsync ${pkgdir}/usr/lib/rsync/rrsync
}

